package com.hbsoft.sub;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;

import com.ant4j.popularize.ui.MainFrame;

import javax.swing.JPanel;

public class FillInBillActionClass 
{
	private FillInBillPanel fibp = null;
	private FillInBill_CenterPanel center = null;
	private InsertAndPrintDialog insert = null;
	
	public FillInBillActionClass(FillInBillPanel fibp)
	{
		this.fibp = fibp;
		init();
		addAction();
	}
	
	private void init()
	{
		center = fibp.getCenter();
	}
	
	private void addAction()
	{
		fibp.getSureButton().addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				
				if(insert==null)
				{
					insert = new InsertAndPrintDialog(MainFrame.getMainFace(),true);
					insert.setVisible(true);
					insert.setLocationRelativeTo(null);
				}
				else{
					insert.setVisible(true);
					insert.setLocationRelativeTo(null);
				}
			}
		});
	}
}
